<template>
	<view>
		<view class="itemView">
			<view v-for="(item,index) in list" :key="index">
				<view @click="itemClick(item)" class="item flex-row-space-between">
					<view class="flex-row-flex-start">
						<view class="itemName">
							{{item.name}}
						</view>
					</view>
					<image class="arrow" src="/static/common/arrow.png" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapActions,
		mapState
	} from "vuex";
	import {
		forum_list,
	} from '@/api/index.js'
	export default {
		components: {},
		computed: {

		},
		data() {
			return {
				
				list: [
					// {
					// 	name: '个人信息',
					// 	icon: '/static/my/1.png',
					// 	value: '',
					// 	url: 'info'
					// },
					// {
					// 		name: '地址管理',
					// 		icon: '/static/my/1.png',
					// 		value: '',
					// 		url: 'address'
					// 	},
					// {
					// 	name: '手机号',
					// 	icon: '/static/my/2.png',
					// 	value: '',
					// 	url: 'phone'
					// },
					// {
					// 	name: '平台协议',
					// 	icon: '/static/my/3.png',
					// 	value: '',
					// 	url: '/pages/login/richText?title=平台协议'
					// },
					{
						name: '退出登录',
						icon: '/static/my/4.png',
						value: '',
						url: 'assistantSettle'
					},
					
				
				],

			}
		},
		computed: {
			...mapState([
				'baseColor'
			]),
		},
		onShow() {
	
		},
		onLoad(e) {
			// this.loadData()
		},
		//下拉刷新
		onPullDownRefresh() {


		},
		//加载更多
		onReachBottom() {

		},
		onPageScroll(e) {
			// if (e.scrollTop > 20) {
			// 	this.backgroundColor = "#FBF9FF"
			// } else {
			// 	this.backgroundColor = "#ffffff00"
			// }
		},
		methods: {
			login(){
				var that=this
				uni.showModal({
					title: '提示',
					content: '是否退出登录?',
					success: function(res) {
						if (res.confirm) {
							uni.removeStorageSync('token')
							uni.removeStorageSync('userinfo')
							uni.removeStorageSync('userInfo')
							that.ws.logout()
							uni.navigateTo({
								url: '/pages/login/login'
							})
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			itemClick(item){
				if(item.name=='退出登录'){
					this.login()
					return
				}
				this.toUrl(item.url)
			},
			loadData () {
			
				var data = {
				id:this.id
				}
				forum_list(data).then(res => {
					this.list=res.data.data
				})
			},
			
			showToast(title) {
				uni.showToast({
					title: title,
					icon: 'none'
				})
			},
			toUrl(url) {
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style lang="scss">
page{
	background: #F9F9F9;
}
.item{
	margin: 30rpx;
		padding: 0 30rpx;
		height: 108rpx;
		border-radius: 36rpx;
		background: #fff;
	}
	
	.itemName{
	font-size: 30rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 550;
	color: #333333;
	}
</style>